package com.grt192.benchtest.mechanism;

import com.grt192.actuator.GRTServo;
import com.grt192.core.Mechanism;
import com.grt192.sensor.GRTAxisCamera;

/**
 *
 * @author anand
 */
public class BenchCameraAssembly extends Mechanism {

    private GRTServo servo;
    private GRTAxisCamera camera;
    private boolean debug;

    public BenchCameraAssembly(int port, boolean debug) {
        camera = new GRTAxisCamera("Camera");
        camera.start();
        addSensor("camera", camera);
        servo = new GRTServo(port);
        addActuator("servo", servo);
        servo.start();
        this.debug = debug;
    }

    public void rotateCamera(double angle) {
        if (debug) {
            System.out.println("C " + angle);
        }
        servo.enqueueCommand(angle);
    }
}
